package com.example.mathtest;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;


import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.wingjay.blurimageviewlib.BlurImageView;

import cn.carbs.android.avatarimageview.library.AvatarImageView;
import jp.wasabeef.glide.transformations.BlurTransformation;
import jp.wasabeef.glide.transformations.CropCircleTransformation;


public class UserActivity extends AppCompatActivity {

    ImageView backImageView;
    ImageView picImageView;
    Toolbar toolbar_usr;

    @SuppressLint("WrongViewCast")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user);
        backImageView = findViewById(R.id.head_back);
        picImageView = findViewById(R.id.head_pic);

        //对头像进行高斯模糊
        Glide.with(this).load(R.drawable.timg).bitmapTransform(new BlurTransformation(this, 25), new CenterCrop(this)).into(backImageView);
        Glide.with(this).load(R.drawable.timg).bitmapTransform(new CropCircleTransformation(this)).into(picImageView);

        //初始化Toolbar实例
        toolbar_usr = findViewById(R.id.toolbar_usr);
        setSupportActionBar(toolbar_usr);

        //返回按钮的监听活动
        toolbar_usr.setNavigationIcon(R.mipmap.ic_keyboard_arrow_left_black_24dp);
        toolbar_usr.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }
}
